Can a whitespace regex character be used to perform a javascript injection? [migrated]

Posted by webose on Pro Webmasters See other posts from Pro Webmasters or by webose
Published on 2012-11-07T19:17:26Z Indexed on 2012/11/07 23:15 UTC
Read the original article Hit count: 139

Filed under:
|

if I want to validate the input of a <textarea>, and want it to contain, for example, only numerical values, but even want to give users the possibility to insert new lines, I can selected wanted characters with a javascript regex that includes even the whitespace characters.

/[0-9\s]/

The question is: do a whitecharacter can be used to perform injections, XSS,even if I think this last option is impossible, or any other type of attack ?

thanks

© Pro Webmasters or respective owner

Related posts about JavaScript

Related posts about security